---@class Battle.BuffEffect1023001:Battle.BuffEffectBase
---[[
--- 消耗5能量或以上的英雄每上场一次，攻击、防御、生命分别提高5%、3%、8%，每个英雄最多累计叠加3次该效果。
---]]
local BuffEffect1023001 = Battle.CreateClass("BuffEffect1023001",Battle.BuffEffectBase)
Battle.BuffEffect1023001 = BuffEffect1023001
function BuffEffect1023001:OnCreate(buff)
    ---@type Battle.Skill
    self.buff = buff;
    ---@type Battle.Entity
    self.param = buff.cfg.f_EffectParameter;
    ---@type table<number,number>
    self.heroId2Overlay = {};--key 英雄id value当前层数 最多3层

end

---buff生效时
function BuffEffect1023001:OnBuffStart(...)
    local param = { ... };
    local actor = Battle.ActorManager.GetActor(self.buff.targetId)
    local target = param[1];
    if actor.camp == target.camp then

        local overlay = self.heroId2Overlay[target.modelId];
        if overlay == nil then
            self.heroId2Overlay[target.modelId] = 1;
            overlay = 1;
        else
            if overlay < 3 then
                overlay = overlay + 1;
            else
                overlay = 3;
            end
        end
        for i, v in pairs(decodeJsonStrToTable(self.param)) do
            target:AddBuff(v[1], overlay, nil, target)
        end
    end
end
return BuffEffect1023001